<%@ page contentType="text/html; charset=UTF-8"%>

<section id="index-signin-section">
	<div class="row-fluid">
		<div class="span6">
			<div class="page-header">
				<h3>Sign in</h3>
			</div>
		</div>
		<div class="span18">
			<form class="form-horizontal" id="signinform"
				action="j_spring_security_check" method="post">
				<fieldset>
					<div class="control-group">
						<label class="control-label" for="j_username">Email</label>
						<div class="controls">
							<input type="text" name="j_username" id="j_username"
								value="${sessionScope['SPRING_SECURITY_LAST_USERNAME']}"
								class="input-xlarge focused">
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="j_password">Password</label>
						<div class="controls">
							<input type="password" name="j_password" id="j_password"
								class="input-xlarge">
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="_spring_security_remember_me">Remember
							me</label>
						<div class="controls">
							<input type="checkbox" name='_spring_security_remember_me'>
						</div>
					</div>
					<div class="form-actions">
						<button type="submit" class="ks-button ks-button-primary">Sign
							in</button>
					</div>
				</fieldset>
			</form>
		</div>
	</div>
</section>

<section id="index-signup-section">
	<div class="row-fluid">
		<div class="span6">
			<div class="page-header">
				<h3>Sign up</h3>
			</div>
		</div>
		<div class="span18">
			<a href="user/signup">Click here!</a>
		</div>
	</div>
</section>

<script>
	KISSY.ready(function(S) {
		S.use("validation", function(S, Validation) {
			var check = new Validation('#signinform', {
				style : "text",
			});

			check.add("#j_username", {
				email : true,
				required : true,
			});

			check.add("#j_password", {
				required : true,
			});

			KISSY.Event.on('#signinform', "submit", function() {
				return check.isValid();
			});

		});
	});
</script>